package com.wkhyapp.lm.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.wkhyapp.lm.R;
import com.wkhyapp.lm.adapter.base.HolderEntity;
import com.wkhyapp.lm.adapter.base.MirAdapter;
import com.wkhyapp.lm.http.vo.Fans;
import com.wkhyapp.lm.http.vo.Member;
import com.wkhyapp.lm.utils.ImageLoadUtil;

import java.util.List;

/**
 * Created by fang on 2021/10/28.
 */

public class SearchShopAdapter extends MirAdapter<Member> {

    public SearchShopAdapter.callBack mCallBack;

    public SearchShopAdapter(Context context, List<Member> mDatas, int itemLayoutId) {
        super(context, mDatas, itemLayoutId);
    }

    @Override
    public void convert(HolderEntity helper, final Member item) {
        helper.setText(R.id.nick_tv,item.getNickname());
        ImageView head_iv = helper.getView(R.id.head_iv);
        ImageLoadUtil.setCirlcleImage_Normals(mContext,item.getHeadImg(),head_iv);
        helper.setText(R.id.rmak_tv,item.getRemark());
        helper.getView(R.id.relativeLayout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mCallBack.action(item);
            }
        });

    }

    public void  setCallBack(SearchShopAdapter.callBack callBack){
        this.mCallBack = callBack;
    }


    public interface  callBack{
        void action(Member item);
    }
}
